<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <title>消息模板</title>
    <meta charset="UTF-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
	<!--bootstrap-->
	<link rel="stylesheet" th:href="@{../statics/css/bootstrap.min.css}"/>
	<link rel="stylesheet" th:href="@{../statics/css/font-awesome.min.css}"/>
	<!--jqgrid-->
	<link rel="stylesheet" th:href="@{../statics/plugins/jqgrid/ui.jqgrid-bootstrap.css}"/>
	<link rel="stylesheet" th:href="@{../statics/plugins/ztree/css/metroStyle/metroStyle.css}"/>
	<!--main-->
	<link rel="stylesheet" th:href="@{../statics/css/main.css}"/>
	<link rel="stylesheet" th:href="@{../statics/css/iview.css}"/>
	<link rel="stylesheet" th:href="@{../statics/css/style.css}"/>
	<!--treegrid-->
	<link rel="stylesheet" th:href="@{../statics/plugins/treegrid/jquery.treegrid.css}"/>
	<!--[if lte IE 9]>
	<link rel="stylesheet" th:href="@{../statics/plugins/treegrid/jquery.treegrid.ie9.css}"/>
	<![endif]-->
	<!--富文本-->
	<link rel="stylesheet" th:href='@{../statics/plugins/froala_editor/css/froala_editor.min.css}'/>
	
	<!--jquery-->
	<script type="text/javascript" th:src="@{../statics/libs/jquery.min.js}"></script>
	<script type="text/javascript" th:src="@{../statics/libs/jQuery.print.js}"></script>
	<!--layer-->
	<script type="text/javascript" th:src="@{../statics/plugins/layer/layer.js}"></script>
	<!--bootstrap-->
	<script type="text/javascript" th:src="@{../statics/libs/bootstrap.min.js}"></script>
	<!--vue-->
	<script type="text/javascript" th:src="@{../statics/libs/vue.min.js}"></script>
	<script type="text/javascript" th:src="@{../statics/libs/iview.min.js}"></script>
	<!--jqgrid-->
	<script type="text/javascript" th:src="@{../statics/plugins/jqgrid/grid.locale-cn.js}"></script>
	<script type="text/javascript" th:src="@{../statics/plugins/jqgrid/jquery.jqGrid.min.js}"></script>
	<!--ztree-->
	<script th:src="@{../statics/plugins/ztree/jquery.ztree.all.min.js}"></script>
	<!--treegrid-->
	<script type="text/javascript" th:src="@{../statics/plugins/treegrid/jquery.treegrid.extension.js}"></script>
	<script type="text/javascript" th:src="@{../statics/plugins/treegrid/jquery.treegrid.min.js}"></script>
	<script type="text/javascript" th:src="@{../statics/plugins/treegrid/jquery.treegrid.bootstrap3.js}"></script>
	<script type="text/javascript" th:src="@{../statics/plugins/treegrid/tree.table.js}"></script>
	
	<script type="text/javascript" th:src="@{../statics/plugins/fullcalendar/moment.min.js}"></script>
	
	<script type="text/javascript" th:src="@{../statics/libs/jquery-extend.js}"></script>
	<script type="text/javascript" th:src="@{../statics/common/js/common.js}"></script>
</head>
<body>
<div id="rrapp" v-cloak>
	<div v-show="showList">
        <Row class="search-panel-space">
            <div class="search-group">
                <i-col span="5">
                	<label class="search-label-20">名称:</label>
                    <i-input v-model="q.name" @on-enter="query" placeholder="名称" class="search-item-width-75"/>
                </i-col>
                <i-button @click="query">查询</i-button>
                <i-button @click="reloadSearch">重置</i-button>
            </div>
        </Row>    
        <Row :gutter="16">
            <div class="buttons-group">
                <i-button type="info" @click="add" th:if="${@shiroAuthService.hasPermission('msgmodelinfo:save')}">
                	<i class="fa fa-plus"></i>&nbsp;新增</i-button>
                <i-button type="warning" @click="update" th:if="${@shiroAuthService.hasPermission('msgmodelinfo:update')}">
                	<i class="fa fa-pencil-square-o"></i>&nbsp;修改</i-button>
                <i-button type="error" @click="del" th:if="${@shiroAuthService.hasPermission('msgmodelinfo:delete')}">
                	<i class="fa fa-trash-o"></i>&nbsp;删除</i-button>
            </div>
        </Row>
	    <table id="jqGrid"></table>
    </div>

    <Card v-show="!showList">
        <p slot="title">{{title}}</p>
		<i-form ref="formValidate" :model="msgModelInfo" :rules="ruleValidate" :label-width="80">
            <Form-item label="编码" prop="code" style="width: 450px;" >
            	<template v-if="msgModelInfo.id">
	                <i-input v-model="msgModelInfo.code" placeholder="编码" readonly="readonly"/>
            	</template>
            	<template v-else>
                	<i-input v-model="msgModelInfo.code" placeholder="编码"/>
            	</template>
            </Form-item>
            <Form-item label="类型" prop="type" style="width: 450px;">
            	<i-select v-model="msgModelInfo.type" placeholder="类型" filterable>
                    <i-option v-for="modelType in msgModelType" :value="modelType.dictKey" :key="modelType.dictKey">{{modelType.dictValue}}</i-option>
                </i-select>
            </Form-item>
            <Form-item label="名称" prop="name" style="width: 450px;">
                <i-input v-model="msgModelInfo.name" placeholder="名称"/>
            </Form-item>
            <Form-item label="描述" prop="content" style="width: 450px;">
                <i-input v-model="msgModelInfo.content" placeholder="描述"/>
            </Form-item>
            <Form-item label="android跳转链接" prop="androidUrl" style="width: 450px;">
                <i-input v-model="msgModelInfo.androidUrl" placeholder="android跳转链接"/>
            </Form-item>
            <Form-item label="ios跳转链接" prop="iosUrl" style="width: 450px;">
                <i-input v-model="msgModelInfo.iosUrl" placeholder="ios跳转链接"/>
            </Form-item>
            <Form-item label="消息内容" prop="msg" style="width: 450px;">
                <i-input type="textarea" v-model="msgModelInfo.msg" placeholder="消息内容"/>
            </Form-item>
            <Form-item label="图标" prop="icon">
			    <div class="multiple-template-upload-list" v-for="item in uploadIconList">
			        <template v-if="item.status === 'finished' ">
			            <img :src="item.url" width="58px" height="58px">
			            <div class="multiple-template-upload-list-cover">
			                <Icon type="ios-eye-outline" @click.native="handleView(item)"></Icon>
			                <Icon type="ios-trash-outline" @click.native="handleRemove"></Icon>
			            </div>
			        </template>
			        <template v-else>
			        	<i-progress :percent="item.percentage" hide-info></i-progress>
			        </template>
			    </div>
            
            	<Upload ref="uploadIconRef" :show-upload-list="false" 
            		:default-file-list="uploadIconList" :on-success="handleSuccessIcon"
			        :format="['jpg','jpeg','png']" :max-size="4096" :on-format-error="handleImgFormatError" 
			        :on-exceeded-size="handleImgMaxSize" :before-upload="handleIconImgBeforeUpload" 
			        action="http://upload.qiniu.com" :data="uploadInfo" style="display: inline-block;width:58px;">
			        <div style="width: 58px;height:58px;line-height: 58px;">
			        	<Icon type="ios-camera" size="20"></Icon>
			        </div>
			    </Upload>
            </Form-item>
            <Form-item>
                <i-button type="primary" @click="handleSubmit('formValidate')">提交</i-button>
                <i-button type="warning" @click="reload" style="margin-left: 8px"/>返回</i-button>
                <i-button type="ghost" @click="handleReset('formValidate')" style="margin-left: 8px">重置</i-button>
            </Form-item>
        </i-form>
	</Card>
</div>

<script th:src="@{../statics/js/sys/msgmodelinfo.js}"></script>
</body>
</html>